<template>
  <div>
    <el-button type="primary" @click="willAdd">添加</el-button>
    <!-- 表格组件 -->
    <v-list @willUpdate="willUpdate"></v-list>
    <!-- 弹框表单组件 -->
    <v-form :status="status" ref="from"></v-form>
    <!-- 分页 -->
    <el-pagination
      layout="prev, pager, next"
      :total="total"
      background
      :page-size="size"
      @current-change="changePage"
    >
    </el-pagination>
  </div>
</template>

<script>
import vForm from "./components/form.vue";
import vList from "./components/list.vue";
import { statusMixins } from "../../mixins";
import { mapActions, mapGetters } from "vuex";
export default {
  components: {
    vList,
    vForm,
  },
  // 引入混入
  mixins: [statusMixins],
  data() {
    return {
      
    };
  },
  methods: {
    ...mapActions({
      reqList: "specs/reqList",
      changePage:"specs/changePage"
    }),
    
    // changePage(aa) {
    //   console.log(aa);
    //   page = aa;
    //   this.reqList();
    // },
  },
  mounted() {
    this.reqList();
  },
  computed: {
    ...mapGetters({
      list: "specs/list",
      // total: "specs/total",
      size: "specs/size",
      page: "specs/page",
      total: "specs/total",
    }),
  },
};
</script>

<style>
</style>